/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nms.base;

/**
 *
 * @author mohamedemara
 */
public class Utility {

    /** This function used to test value is null or not like java script boolean
     * concept
     * @param value
     *            value to check
     * @return true is value not null or String value not empty
     * 
     */
    public static boolean hasValue(Object value) {
        if (value == null) {
            return false;
        } else if (value instanceof String) // check if value String
        {
            if (((String) value).isEmpty()) // check if String value empty
            {
                return false;
            } else if (value instanceof Object[]) // check if value String
            {
                if (((Object[]) value).length == 0) // check if String value empty
                {
                    return false;
                }
            }
        }
        return true;
    }
    
     



}
